package com.dm.server.Task;
/*
@Component
@Slf4j
public class OrderTask{

    @Autowired
    private VoucherOrderMapper voucherOrderMapper;

    @Scheduled(cron = "0 * * * * ?")
    public void processTimeoutOrder(){

        LocalDateTime plus = LocalDateTime.now().plusMinutes(-15);
        Log.info("定时处理超时订单：{}");
        List<VoucherOrder> byStatusAndOrderTimeLT = voucherOrderMapper.getByStatusAndOrderTimeLT(VoucherOrder.NO_PAY, plus);
        if(byStatusAndOrderTimeLT!=null&&byStatusAndOrderTimeLT.size()>0){
            for (VoucherOrder voucherOrder:byStatusAndOrderTimeLT) {
                voucherOrder.setStatus(voucherOrder.CANCEL);
                voucherOrder.setUpdateTime(LocalDateTime.now());
                voucherOrderMapper.updateById(voucherOrder);
            }
        }

    }

}
*/
